#define _CRT_SECURE_NO_WARNINGS 1


#include <iostream>
using namespace std;
#include "Sort.h"


void InsertSortTest()
{
	int a[] = { 0, 9, 8, 7, 6, 5, 4, 3, 2, 1};
	int n = sizeof(a) / sizeof(a[0]);
	InsertSort(a, n);

	for (int i = 0; i < n; i++)
		printf("%d ", a[i]);

	puts("");
}

void ShellSort()
{
	int a[] = { 0, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
	int n = sizeof(a) / sizeof(a[0]);
	ShellSort(a, n);

	for (int i = 0; i < n; i++)
		printf("%d ", a[i]);
	
	puts("");
}

void SelectSort1()
{
	int a[] = { 0, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
	int n = sizeof(a) / sizeof(a[0]);
	SelectSort1(a, n);

	for (int i = 0; i < n; i++)
		printf("%d ", a[i]);

	puts("");
}

void SelectSort2()
{
	int a[] = { 0, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
	int n = sizeof(a) / sizeof(a[0]);
	SelectSort2(a, n);

	for (int i = 0; i < n; i++)
		printf("%d ", a[i]);

	puts("");
}

void BuluBul1()
{
	int a[] = { 0, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
	int n = sizeof(a) / sizeof(a[0]);
	BuluBul1(a, n);

	for (int i = 0; i < n; i++)
		printf("%d ", a[i]);

	puts("");
}

void BuluBul2()
{
	int a[] = { 0, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
	int n = sizeof(a) / sizeof(a[0]);
	BuluBul2(a, n);

	for (int i = 0; i < n; i++)
		printf("%d ", a[i]);

	puts("");
}

void HeapSort()
{
	int a[] = { 0, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
	int n = sizeof(a) / sizeof(a[0]);
	HeapSort(a, n);
	for (int i = 0; i < n; i++)
		printf("%d ", a[i]);

	puts("");
}

void QuickSort1()
{
	int a[] = { 0, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
	int n = sizeof(a) / sizeof(a[0]);
	QuickSort1(a, 0, n - 1);
	for (int i = 0; i < n; i++)
		printf("%d ", a[i]);

	puts("");
}

void QuickSort2()
{
	int a[] = { 0, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
	int n = sizeof(a) / sizeof(a[0]);
	QuickSort2(a, 0, n - 1);
	for (int i = 0; i < n; i++)
		printf("%d ", a[i]);

	puts("");
}

void QuickSort3()
{
	int a[] = { 0, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
	int n = sizeof(a) / sizeof(a[0]);
	QuickSort3(a, 0, n - 1);
	for (int i = 0; i < n; i++)
		printf("%d ", a[i]);

	puts("");
}

void QuickSort4()
{
	int a[] = { 0, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
	int n = sizeof(a) / sizeof(a[0]);
	QuickSort4(a, 0, n - 1);
	for (int i = 0; i < n; i++)
		printf("%d ", a[i]);

	puts("");
}

void QuickSort5()
{
	int a[] = { 0, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
	int n = sizeof(a) / sizeof(a[0]);
	QuickSort5(a, 0, n - 1);
	for (int i = 0; i < n; i++)
		printf("%d ", a[i]);

	puts("");
}

void QuickSort6()
{
	int a[] = { 0, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
	int n = sizeof(a) / sizeof(a[0]);
	QuickSort6(a, 0, n - 1);
	for (int i = 0; i < n; i++)
		printf("%d ", a[i]);

	puts("");
}

void QuickSort7()
{
	int a[] = { 0, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
	int n = sizeof(a) / sizeof(a[0]);
	QuickSort7(a, 0, n - 1);
	for (int i = 0; i < n; i++)
		printf("%d ", a[i]);

	puts("");
}

void MergeSort1()
{
	int a[] = { 0, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
	int n = sizeof(a) / sizeof(a[0]);
	MergeSort(a, n);
	for (int i = 0; i < n; i++)
		printf("%d ", a[i]);

	puts("");
}

int main()
{
	InsertSortTest();
	ShellSort();
	SelectSort1();
	SelectSort2();
	BuluBul1();
	BuluBul2();
	HeapSort();
	QuickSort1();
	QuickSort2();
	QuickSort3();
	QuickSort4();
	QuickSort5();
	QuickSort6();
	QuickSort7();
	MergeSort1();
	return 0;
}